import { type IconProps, NIcon } from 'naive-ui'
import { h } from 'vue'
import SvgIcon from '@/components/common/svg-icon.vue'

export * from './is'

export function renderIcon(icon: string, size: number = 18, props: IconProps = {}) {
  return h(
    NIcon,
    { size, ...props },
    {
      default: () => h(SvgIcon, { icon }),
    },
  )
}
